package hn.info.hockeynews.helpers;

import java.util.ArrayList;
import java.util.List;

import org.apache.http.NameValuePair;
import org.apache.http.message.BasicNameValuePair;
import org.json.JSONObject;

public class JSONAsync{
	private JSONParser jsonParser;
	
	//private static String id="164";
    //Testing in localhost using wamp or xampp
    //use http://10.0.2.2/ to connect to your localhost ie http://localhost/
    //= "http://hockey-news.info/androidapp/index2.php";
	private String tag;
    private String url;
    private String tId;
    
    //private String getmatch; // = "getTickerEntries"
    JSONObject json = null;
    String js ="";
    // constructor
    public JSONAsync() {
    }
 
    /**
     * function make Login Request
     * @param email
     * @param password
     *
     */
    public JSONObject getData() {
        List<NameValuePair> params = new ArrayList<NameValuePair>();
        params.add(new BasicNameValuePair("tag", tag));
        params.add(new BasicNameValuePair("id", tId));
    	jsonParser = new JSONParser(url, params);
    	json = jsonParser.doInBackground();
        return json;
    }

	public String getUrl() {
		return url;
	}

	public void setUrl(String url) {
		this.url = url;
	}

	public String gettId() {
		return tId;
	}

	public void settId(String tId) {
		this.tId = tId;
	}

	public String getTag() {
		return tag;
	}

	public void setTag(String tag) {
		this.tag = tag;
	}
}